package com.hc.model.code02.test7;

import java.io.IOException;
import java.io.InputStream;

/**
 * @version v1.0
 * @ClassName: RuntimeTest
 * @Description: runtime方法的使用
 * @Author: HC
 */
public class RuntimeTest {

    public static void main(String[] args) throws IOException {
        Runtime runtime = Runtime.getRuntime();
        Process process = runtime.exec("ipconfig");
        // 拿到输入流对象
        InputStream is = process.getInputStream();
        byte[] bytes = new byte[1024 * 1024 * 1000];
        int read = is.read(bytes);
        System.out.println(new String(bytes, 0, read, "GBK"));
    }
}
